package com.user.controller;


import com.common.domain.entity.ResponseResult;
import com.common.domain.entity.Volunteer;
import com.common.service.VolunteerService;
import com.common.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/volunteer")
public class VolunteerController {

    @Autowired
    private VolunteerService volunteerService;

    @GetMapping("list")
    public ResponseResult allVolunteerList(Integer pageNum, Integer pageSize){
        return volunteerService.allVolunteerList(pageNum,pageSize, null, SecurityUtils.getUserId());
    }

    @GetMapping("logList")
    public ResponseResult allVolunteerLogList(Integer pageNum, Integer pageSize){
        return volunteerService.allVolunteerLogList(pageNum , pageSize);
    }

    @GetMapping("/application")
    public ResponseResult application(Long id){
        return volunteerService.application(id);
    }
}
